package com.library.po;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.util.Date;

@Component
@Data
@AllArgsConstructor
@NoArgsConstructor
public class LendList implements Serializable {
    private Integer id;
    private Integer bookId;//图书id
    private Integer readerId;//读者id

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")//接收页面输入的时间，将其格式化
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")//后端传的日期格式化
    private Date lendDate;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date backDate;
    private Integer backType;
    private String exceptRemarks;
    private BookInfo bookInfo;//书籍实体
    private ReaderInfo readerInfo;//读者实体
    private static final long serialVersionUID = 1L;
}